package com.yuncheng.oaApi.constant;


import org.springframework.stereotype.Component;

/**
* @Author: lhb
* @Description : 离岗请示
* @DateTime: 2023-6-27 17:40
* @Params:
*/

@Component(value = "OaLgqsFlowConstant")
public class OaLgqsOaFlowConstants implements OaFlowConstants {

        public final static String LCMC_LIKE_OALC = "自治区食品药品审评查验中心干部职工离岗请示（请假）登记流程";

        //流程环节
        public final static String NODENAME = "离岗申请,科室审批,分管领导审批,销假";

        public final static String HJMC_QJSQ = "离岗申请";
        public final static String HJMC_KSQP = "科室审批";
        public final static String HJMC_FGSP = "分管领导审批";
        public final static String HJMC_XJ ="销假";

        // 流程办理按钮类型 - 保存
        public final static String SUBMIT_TYPE_SAVE = "0";

        // 流程办理按钮类型 - 提交
        public final static String SUBMIT_TYPE_SUBMIT = "1";


        // 获取第一环节
        public String getFirstNode() {
            String nodeNameList[] = NODENAME.split(",");
            return nodeNameList[0];
        }


        //办理方式
        public String getBlfs(String nodeName) {
            return OaCommonFlowConstant.BLFS_DRJJ;
        }

        //流程编码
        @Override
        public String getFywflcode() {
            return "oalgqs001";
        }

        //获取流程名称
        @Override
        public String getFlowName() {
            return "自治区食品药品审评查验中心干部职工离岗请示（请假）登记流程";
        }

        // 获取下环节名称
        public String getNextNodeName(String nowNodeName) {
            String nodeNameList[] = NODENAME.split(",");
            for (int i = 0; i < nodeNameList.length; i++) {
                if (nodeNameList[i].equals(nowNodeName)) {
                    if (i == nodeNameList.length - 1) {
                        return HJMC_LCJS;
                    } else {
                        return nodeNameList[i + 1];
                    }
                }
            }
            return "";
        }

        // 获取上一个环节名称
        public String getPreviousName(String nowNodeName) {
            String[] nodeNameList = NODENAME.split(",");

            for (int i = 0; i < nodeNameList.length; i++) {
                if (nodeNameList[i].equals(nowNodeName)) {
                    if (i == 0) {
                        return nodeNameList[i];
                    } else {
                        int perviousI = i - 1; // 上一个环节名称
                        return nodeNameList[perviousI];
                    }
                }
            }
            return "";
        }

        // 获取审评下环节名称
        public String getSpNextNodeName(String nowNodeName) {

            return null;
        }

        // 获取审评上环节名称
        public String getSpPreviousName(String nowNodeName) {

            return null;
        }


}
